package sctu.edu.java.year2016.team05.lizixin.day20160617.chapter15_1;

import jdk.management.resource.internal.inst.SocketOutputStreamRMHooks;

/**
 * Created by home on 2016/6/17.
 * 尝试定义一个继承Thread类的类，并覆盖run()方法。在run方法中每隔100毫秒打印一句话。
 */
public class ThreadTest extends Thread {
    public void run() {
        int i;
        for (i = 1; i <= 10; i++) {
            System.out.println("I love you!");
            try {
                Thread.sleep(100);
            } catch (Exception e) {
                e.printStackTrace();


             }
        }


    }

    public static void main(String[] args) {
        ThreadTest a = new ThreadTest();
        a.start();
    }
}
